<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="/admin/js-css/css/style.css" />
    <link rel="stylesheet" type="text/css" href="/admin/js-css/css/skin_/main.css" />
    <link rel="stylesheet" type="text/css" href="/admin/js-css/css/jquery.dialog.css" />
    <script type="text/javascript" src="/admin/js-css/js/jquery.js"></script>
    <script type="text/javascript" src="/admin/js-css/js/global.js"></script>

    <link rel="stylesheet" href="/admin/plugin/layui/dist/css/layui.css" tppabs="http://res.layui.com/layui/dist/css/layui.css"  media="all">
    <script src="/admin/plugin/layui/dist/layui.js" charset="utf-8"></script>
    <script src="/admin/js-css/js/mx1.0.js" charset="utf-8"></script>
    <title>总后台管理平台</title>
    <style>
        iframe{
            display:block;
        }
    </style>
</head>

<body>
<div id="container">
    <div id="hd">
        <div class="hd-top">
            <div class="nav-wrap">
                <h1 class="logo"></h1>
                <ul class="nav ue-clear">
                    <li><a href="javascript:;" id="navdefault" leftUrl="/admin/html/dataManagement/tree.html" onclick="openlocal(this)" >业务功能</a></li>
                    <li style="display: none;" id="lanmuguanli" ><a href="javascript:;" leftUrl="/admin/html/columnManagement/tree.html" onclick="openlocal(this)" >栏目管理</a></li>
                    <li style="display: none;" id="ziduanpeizhi"><a href="javascript:;" leftUrl="/admin/html/fieldConfiguration/tree.html" onclick="openlocal(this)">字段配置</a></li>
                </ul>
            </div>
            <div class="user-info">
                <a href="javascript:;" class="user-avatar"><span></span></a>
                <span class="user-name">admin</span>
                <a href="javascript:;" class="more-info"></a>
            </div>
        </div>
    </div>
    <div id="bd" style="line-height: 0;">
        <iframe id="mainIframe" width="100%" height="100%" src="/admin/html/index.html" frameborder="0"></iframe>
    </div>
</div>

<div class="exitDialog">
    <div class="content">
        <div class="ui-dialog-icon"></div>
        <div class="ui-dialog-text">
            <p class="dialog-content">你确定要退出系统？</p>
            <p class="tips">如果是请点击“确定”，否则点“取消”</p>

            <div class="buttons">
                <input type="button" class="button long2 ok" value="确定" />
                <input type="button" class="button long2 normal" value="取消" />
            </div>
        </div>

    </div>
</div>

<div class="opt-panel user-opt" style="top:52px;right:0px;">
    <ul>
        <li><a class="text" onclick="f_pass()">修改密码</a></li>
        <li><a class="text" onclick="logout()">退出系统</a></li>
    </ul>
    <div class="opt-panel-tl"></div>
    <div class="opt-panel-tc"></div>
    <div class="opt-panel-tr"></div>
    <div class="opt-panel-ml"></div>
    <div class="opt-panel-mr"></div>
    <div class="opt-panel-bl"></div>
    <div class="opt-panel-bc"></div>
    <div class="opt-panel-br"></div>
    <div class="opt-panel-arrow"></div>
</div>

<div class="opt-panel skin-opt" style="top:36px;right:157px;">
    <ul class="ue-clear">
        <li attr-color="#0f8dc7"></li>
        <li attr-color="#1ea4a9"></li>
        <li attr-color="#eb7f00"></li>
        <li attr-color="#ed0f04"></li>
        <li attr-color="#f24b39"></li>
        <li attr-color="#ed0f04"></li>
        <li attr-color="#eb7f00"></li>
        <li attr-color="#ed0f04"></li>
        <li attr-color="#1ea4a9"></li>
    </ul>
    <div class="opt-panel-ml"></div>
    <div class="opt-panel-mr"></div>
    <div class="opt-panel-bl"></div>
    <div class="opt-panel-bc"></div>
    <div class="opt-panel-br"></div>
</div>

<div class="system-switch">
    <ul>
        <li>
            <span class="system-name"><i></i>数字管理系统</span>
        </li>
        <li>
            <span class="system-name"><i></i>网络信息管理系统</span>
        </li>
        <li>
            <span class="system-name"><i></i>后台管理系统</span>
        </li>
        <li>
            <span class="system-name"><i></i>信息科技ERP系统</span>
        </li>
        <li>
            <span class="system-name"><i></i>网络管理系统</span>
        </li>
    </ul>
    <div class="opt-panel-mr"></div>
    <div class="opt-panel-bc"></div>
    <div class="opt-panel-br"></div>
</div>

</body>
<script type="text/javascript" src="/admin/js-css/js/core.js"></script>
<script type="text/javascript" src="/admin/js-css/js/jquery.dialog.js"></script>
<script type="text/javascript">

    var loginuser = localStorage.getItem("user");
    var login_user = JSON.parse(loginuser);
    $(".user-name").html(login_user.login_name);

    $("#bd").height($(window).height() - $("#hd").outerHeight());


    $(window).resize(function (e) {
        $("#bd").height($(window).height() - $("#hd").outerHeight());

    });

    $('.exitDialog').Dialog({
        title: '提示信息',
        autoOpen: false,
        width: 400,
        height: 200
    });

    $('.exit').click(function () {
        $('.exitDialog').Dialog('open');
    });

    $('.exitDialog input[type=button]').click(function (e) {
        $('.exitDialog').Dialog('close');

        if ($(this).hasClass('ok')) {
            window.location.href = "login.html";
        }
    });

    $('.hd-top .user-info .more-info').click(function(e) {
        $(this).toggleClass('active');
        $('.user-opt').toggle();
    });

    function logout(){
        post("/admin/api/UserController/logout",{},function (res) {
            window.location.href = "/admin/html/login.html";
        })

    }

    function f_pass(){
        f_layer_open_get("/admin/html/pass/input.html","40%","40%",null,null,"修改密码",null);
    }


    window.setTimeout(function () {
        $("#navdefault").click();
    },350);

    function openlocal(o) {
        mainIframe.contentWindow.leftOpen($(o).attr("leftUrl"));
    }


    function f_layer_open(url, width, height, closeFun, buttons, title, parms) {
        if(width == ""){
            width = "60%";
        }
        if(height == ""){
            height = "90%";
        }
        var layer_id = "" + new Date().getTime();
        var config = {
            id: layer_id,
            type: 2,
            title: title,
            area: [width, height],
            fixed: false, //不固定
            maxmin: true,
            content: "about:blank",
            end: function () {
                if (closeFun) {
                    closeFun();
                }
            }, cancel: function () {
                var index = layer.getFrameIndex(layer_id); //先得到当前iframe层的索引
                layer.close(index);
                return true;
            }
        };
        if (buttons) {
            copy(buttons, config);
        }

        //iframe层-父子操作
        layer.open(config);
        f_post_submit(layer_id, parms, url);


    }


    function f_post_submit(layer_id, parms, url) {
        var win = getTopIframe($("#" + layer_id));
        $("#form_submit").attr("target", win.name);
        $("#form_submit").attr("action", url);
        var hidden = "";
        for (var k in parms) {
            hidden = hidden + "<input type=\"hidden\" name=\"" + k + "\" value=\"" + parms[k] + "\" />";
        }
        hidden = hidden + "<input type=\"hidden\" name=\"layer_id\" value=\"" + layer_id + "\" />";
        $("#form_submit").html(hidden);
        $("#form_submit").submit();
    }


    function f_layer_open_get(url, width, height, closeFun, buttons, title, formData) {
        if(width == ""){
            width = "60%";
        }
        if(height == ""){
            height = "90%";
        }
        var layer_id = "" + new Date().getTime();
        var config = {
            id: layer_id,
            type: 2,
            offset: '25px',
            title: title,
            area: [width, height],
            fixed: false, //不固定
            maxmin: true,
            content: url,
            success: function (layero, index) {
                if (formData) {
                    var body = layer.getChildFrame('body', index);
                    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    iframeWin.setData(formData);
                }
            },
            end: function () {
                if (closeFun) {
                    closeFun();
                }
            }, cancel: function () {
                var index = layer.getFrameIndex(layer_id); //先得到当前iframe层的索引
                layer.close(index);
                return true;
            }
        };
        if (buttons) {
            copy(buttons, config);
        }

        //iframe层-父子操作
        layer.open(config);

    }


    function alert(msg) {
        layer.msg(msg);
    }

    var data = {
        user:JSON.parse(localStorage.getItem("user"))
    };
    if(data.user.is_super_admin == "1"){
        $("#lanmuguanli").show();
        $("#ziduanpeizhi").show();
    }



</script>

</html>
